<template>
  <div>
    <transition name="fade" mode="out-in">
      <keep-alive :include="pages">
        <component :is="currentView"></component>
      </keep-alive>
    </transition>
  </div>
</template>

<script>
  import CostCount from './costCount'
  import CostExamine from './costExamine'
  import CostVerify from './costVerify'

  // 0-监管科 confirm
  // 1-区 auditing
  // 2-市 review
  // 3-送审 send
  const map = {
    count: 0,
    examine: 1,
    verify: 2
  }

  export default {
    name: 'chkCost',
    data() {
      return {
        index: null,
        views: ['CostCount', 'CostExamine', 'CostVerify'],
        pages: ['costCount', 'costExamine', 'costVerify']
      }
    },
    computed: {
      currentView() {
        return this.views[map[this.$route.meta.code]]
      }
    },
    created() {
      console.log(this.$route.meta.code)
      console.log(map[this.$route.meta.code])
    },
    methods: {
      back() {
        this.changeView(this.$route.meta.code)
      }
    },
    components: {
      CostCount,
      CostExamine,
      CostVerify
    }
  }
</script>


<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" rel="stylesheet/scss" type="text/scss">

</style>
